Skip to content

fix(coverage): intercept .output, which was read whole - #24

Merged
HackPoint merged 1 commit into
mainfrom
fix/intercept-output-extension
Aug 1, 2026
Merged

fix(coverage): intercept .output, which was read whole#24
HackPoint merged 1 commit into
mainfrom
fix/intercept-output-extension

Conversation

@HackPoint

Copy link
Copy Markdown
Owner

Closes #10.

.out was in the log extension list, .output was not. Matching is exact, so .output never
matched out and those files were read whole — 54 reads, 9,547 tokens above the threshold.

The word was missing from all three copies of the list (the coverage::LOG_EXTS constant, the
shipped hook template, and the repo's developer hook) because nothing compared the shell copies to
the constant. The new drift test drives its assertion from the constant, so the next addition can't
land in one copy only.

Optimizer comparison

full returned saved
.output file, before 13,842 13,842 0 (read whole)
after 13,842 1,062 92.3%

No existing scenario changed. The baseline diff is 9 added lines, nothing removed or modified —
checked programmatically, not by eye:

added:     ['compress_logs/output_extension']
regressed: none

Tests

kind what
unit classify() for .output, the whole LOG_EXTS set, and .outputs staying out
drift both intercept copies route every extension in the constant
e2e the generated hook, run for real against a 400-line .output: exits 2 and names compress_logs
bench new scenario in optimizer_bench

One trap worth noting: out| is a substring of output|, so a contains check would have reported
.out as routed even if only .output were present. The test splits the case arm on its own
delimiters instead.

Local gate green before pushing.

…st stopped one word short

`.out` was in LOG_EXTS and `.output` was not. Extension matching is exact, so `.output` never
matched `out` and every build or test run redirected to one was read whole — 54 recorded reads,
9,547 tokens at or above the threshold.

The list lives in three places (lumen_core::coverage::LOG_EXTS, INTERCEPT_TEMPLATE, and the repo's
developer hook) and the word was missing from all of them, because nothing compared the shell copies
to the constant. The new drift test drives its assertion from the constant, so the next addition
cannot land in one copy only.

One trap while writing it: `out|` is a substring of `output|`, so a `contains` check would report
`.out` as routed even if only `.output` were present. The arm is split on its own delimiters instead.

Tests, per the rule that every fix carries all four:
  unit  - classify() for .output, the whole LOG_EXTS set, and .outputs staying out
  drift - both intercept copies route every extension in the constant
  e2e   - the generated hook run for real against a 400-line .output: exits 2 and names compress_logs
  bench - a new scenario, 13,842 -> 1,062 tokens (92.3% saved)

No existing benchmark scenario moved: the baseline diff is nine added lines and nothing else.
@HackPoint
HackPoint merged commit 0c916c0 into main Aug 1, 2026
12 checks passed
@HackPoint
HackPoint deleted the fix/intercept-output-extension branch August 1, 2026 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.out is intercepted but .output is not

1 participant